﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Things.Bar;
using Things.Bar.Models;

namespace Things.Web.GoodBar
{
    public partial class ViewNotice : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Guid id = new Guid(Request["id"]);
                NoticeRepository rep = new NoticeRepository();
                Notice notice = rep.Find(id);

                _ctlTitle.InnerHtml = notice.Title;
                _ctlTitle2.InnerText = string.Format("发表时间:{0}", notice.CreatedTime.ToString("yyyy年MM月dd日"));
                _ctlContent.InnerHtml = notice.Content;
            }
            catch
            {
                Response.Redirect("./Default.aspx");
            }
        }
    }
}